#读取文章
def count_the(filename):
    try:
        with open(filename,encoding="utf-8") as f:
            contents = f.read()
            nums=contents.lower().count('the ')
    except FileNotFoundError:
        print(f"文件{filename}不存在!")
    else:
        print(nums)


filenames = ["alice.txt","little_women.txt","soddhartha.txt","moby_dick.txt"]
for filename in filenames:
    count_the(filename)
